--- title: RingCube keywords: fastai sidebar: home_sidebar summary: "Class for analysis of ISS Ring Images" description: "Class for analysis of ISS Ring Images" nb_path: "09_ringcube.ipynb" ---
{% raw %}
Stored index is up-to-date.
{% endraw %} {% raw %}
{% endraw %} {% raw %}
Stored index is up-to-date.
{% endraw %}

Helpers

{% raw %}

calc_4_3[source]

calc_4_3(width)

Calculate 4:3 ratio for figures.

so that they import nicely in prezzies.

Parameters
----------
width : int, float
    Width of plotting window
{% endraw %} {% raw %}
{% endraw %} {% raw %}

mad[source]

mad(arr, relative=True)

Median Absolute Deviation: a "Robust" version of standard deviation.
Indices variabililty of the sample.
https://en.wikipedia.org/wiki/Median_absolute_deviation
{% endraw %} {% raw %}
{% endraw %} {% raw %}

calc_offset[source]

calc_offset(cube)

Calculate an offset.

Calculate offset from the side of data so that at least 200 image pixels are in the MAD stats.

Parameters
==========
cube : pyciss.ringcube.RingCube
    Cubefile with ring image
{% endraw %} {% raw %}
{% endraw %} {% raw %}

class RingCube[source]

RingCube(fname, plot_limits=(0.1, 99), destriped=True, pixres=None, litstatus=None, **kwargs) :: CubeFile

A Isis Cube file reader.

Copied from the `pysis` package.
{% endraw %} {% raw %}
{% endraw %} {% raw %}
pm = PathManager("n1495327339")
pm
cal_cub: not found.
calib_img: not found.
calib_label: not found.
cubepath: not found.
dst_cub: not found.
raw_cub: not found.
raw_image: not found.
raw_label: not found.
tif: not found.
undestriped: not found.
{% endraw %} {% raw %}
cube = RingCube(pm.cubepath)
N1495327339
{% endraw %} {% raw %}
cube.imshow()
<matplotlib.image.AxesImage at 0x7fed2c190be0>
{% endraw %} {% raw %}
cube.profile_plot
{% endraw %} {% raw %}
cube.profile_vs_absmad
<ipython-input-9-84b68454b9d2>:382: RuntimeWarning: invalid value encountered in subtract
  subtracted = self.img - self.median_profile[:, np.newaxis]
{% endraw %} {% raw %}
ds = cube.xdataset
<ipython-input-9-84b68454b9d2>:382: RuntimeWarning: invalid value encountered in subtract
  subtracted = self.img - self.median_profile[:, np.newaxis]
{% endraw %} {% raw %}
ds
<xarray.Dataset>
Dimensions:    (azimuth: 14006, radius: 4027)
Coordinates:
  * azimuth    (azimuth) float64 277.7 277.7 277.7 277.7 ... 280.9 280.9 280.9
  * radius     (radius) float64 122.4 122.4 122.4 122.4 ... 124.4 124.4 124.4
    _file_obj  object None
Data variables:
    img        (azimuth, radius) float64 nan nan nan nan nan ... nan nan nan nan
    sub        (azimuth, radius) float64 nan nan nan nan nan ... nan nan nan nan
    absmad     (radius) float64 nan 0.001558 0.003923 ... 0.003051 0.003051 nan
    relmad     (radius) float64 nan 0.004055 0.01029 ... 0.00884 0.00884 nan
    median_az  (radius) float64 nan 0.3842 0.3814 0.3775 ... 0.3452 0.3452 -inf
    amin       (radius) float64 nan 0.3826 0.3775 0.3716 ... 0.3421 0.3421 nan
    amax       (radius) float64 nan 0.3857 0.3853 0.3834 ... 0.3482 0.3482 nan
{% endraw %} {% raw %}
ds.img.hvplot(datashade=True)
{% endraw %} {% raw %}
ds.sub.hvplot(datashade=True)
{% endraw %}